package active.iterators;

import constructor.composite.Deparment;

import java.util.Iterator;
import java.util.List;

public class InfoCollegeIterator implements Iterator {

    List<Deparment> deparmentList;
    int posi = 0;

    public InfoCollegeIterator(List<Deparment> deparmentList) {
        this.deparmentList = deparmentList;
    }

    @Override
    public boolean hasNext() {
        if (posi >= deparmentList.size()) {
            return false;
        }
        return true;
    }

    @Override
    public Object next() {
        Deparment deparment = deparmentList.get(posi);
        posi++;
        return deparment;
    }
}
